From: Kentaro Hayashi Date: Sat, 1 Aug 2026 12:47:10 +0000 (+0900) Subject: Support to build python module with pybuild X-Git-Tag: archive/raspbian/0.2.2-1+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a2e55e2664318e04c916655d4a53d88c5657e954;p=sentencepiece.git Support to build python module with pybuild Description: Support to build python module with pybuild Forwarded: not-needed Last-Update: 2026-08-01 Gbp-Pq: Name support-building-python-module.patch --- diff --git a/python/setup.py b/python/setup.py index 60e0811..078a258 100755 --- a/python/setup.py +++ b/python/setup.py @@ -69,6 +69,18 @@ def get_protobuf_includes(): def get_cflags_and_libs(root): + if os.environ.get('USE_SHARED_SENTENCEPIECE') == '1': + include_dirs = os.environ['SENTENCEPIECE_INCLUDE_DIR'] + library_dir = os.environ['SENTENCEPIECE_LIBRARY_DIR'] + cflags = ['-std=c++17'] + for include_dir in include_dirs.split(os.pathsep): + if include_dir: + cflags.append('-I' + os.path.normpath(include_dir)) + return cflags, [ + '-L' + os.path.normpath(library_dir), + '-lsentencepiece', + '-lsentencepiece_train', + ] cflags = [ '-std=c++17', '-I' + os.path.normpath(os.path.join(root, 'include')),